Recently, wide-area Ethernet has been introduced in place of IP-VPN (Virtual Private Network) for the purpose of suppressing equipment costs when an intranet is architected. An L2 (layer 2) switch used when the wide-area Ethernet is architected has a MAC (media Access Control) learning function, and executes frame transmission.
Here, according to the MAC learning function in the L2 switch, “MAC address of transmission source” and “reception port” of a frame received by the L2 switch are stored as a pair in an FDB (Forwarding Database), and when a frame having a MAC address stored in the FDB as a destination is received from another port, the frame is not transmitted to all the ports, but the frame is transmitted to only learned ports, thereby canceling needless traffic.
Furthermore, the MAC learning function has an aging function. According to this aging function, when the L2 switch has not received a frame having a learned MAC address of transmission source within a fixed time, it is assumed that no communication is executed, and thus an entry is deleted from the FDB. A timer for executing countdown while no frame is received is called an “aging timer.” The L2 switch resets the corresponding aging timer to the maximum value every time a frame having learned a “MAC address of transmission source” is received.
FIG. 10 is a diagram illustrating the MAC learning function in the conventional L2 switch. As illustrated in FIG. 10, the L2 switch 50 has ports 1 to 4 and FDB 50a. The ports 1, 2 are connected to an L2 network 20, and the ports 3 and 4 are connected to an L2 network 30. The port identification information of each of the ports 1 to 4 is set to “1” to “4” respectively.
For example, when the L2 switch 50 receives a frame of a terminal 10a (the MAC address of the terminal 10a is represented by “MAC-A”) from the port 1, the port identification information “1”, the MAC address “MAC-A”, and the value of the aging timer are stored in FDB 50 in association with one another. When the L2 switch 50 receives a frame addressed to the terminal 10a from L2 network 30 in a state that an entry as described above is stored in FDB 50a, the L2 switch 50 transmits the frame from the port 1.
Thereafter, when the terminal 10a moves and the L2 switch 50 receives the frame from the terminal 10a through the port 2, the port identification information corresponding to the MAC address “MAC-A” is set to “2” and the aging timer is set to “300 seconds”, thereby updating FDB 50a (the maximum value of the aging timer is set to 300 seconds).
In the L2 networks 20 and 30, a frame may be looped when a connection miss, a device bug, or the like occurs. FIG. 11 is a diagram illustrating a problem caused by the looping of a frame. In FIG. 11, the MAC address of the terminal 10a is represented by “MAC-A”, and the MAC address of the terminal 10b is represented by “MAC-B”.
As illustrated in FIG. 11, the L2 switch 50 obtains a frame (the MAC address “MAC-A” of a transmission source, the MAC address “MAC-B” of the transmission destination) from the port 1, determines that the transmission port of the frame is port 3 on the basis of the FDB 50a, and transmits the frame from the port 3. Thereafter, when the frame is looped through the network 30 and returned to the port 4 of the L2 switch 50, the L2 switch 50 assumes that the terminal 10a moves (although the terminal 10a does not actually move) and updates FDB 50a (the port identification information corresponding to the MAC address “MAC-A” is updated from “1” to “4”).
As described above, when the L2 switch 50 updates the FDB 50a, the frame is transmitted from the port 4 to the port 3 again because the address of the transmission source is set to “MAC-B”, so that the frame is permanently looped between the port 3 and the port 4.
Furthermore, when the L2 switch 50 receives a frame addressed to the terminal 10a in the state that the FDB 50a is erroneously updated, the frame cannot be properly transmitted to the terminal 10a. Accordingly, in order to overcome the problem illustrated in FIG. 11, the L2 switch 50 judges whether the frame is in a loop or not, and if the frame is in a loop, the frame in a loop should be discarded without updating the FDB 50a. 
Here, a technique of judging whether a frame is in a loop is disclosed in, for example, Japanese Patent Laid-open number JP-A-2006-173785. In JP-A-2006-173785, a terminal moving state where packets of the same transmission source address are input to different ports is detected, and by counting a detection frequency of the terminal moving state for every port, whether the frame is in a loop or not is judged.